<?php
	include_once('phpbb2_settings.php');

	define('IN_PHPBB', true);
	include($phpbb_root_path . 'extension.inc');
	include($phpbb_root_path . 'common.'.$phpEx);

	$userdata = session_pagestart($user_ip, PAGE_LOGIN);
	init_userprefs($userdata);

	$return = $_GET['return'];

	if ($sid == '' || $sid != $userdata['session_id'])
	{
		//message_die(GENERAL_ERROR, 'Invalid_session');
	}

	if( $userdata['session_logged_in'] )
	{
		session_end($userdata['session_id'], $userdata['user_id']);
	}

	//echo '<a href = "' . $return . '">success, continue</a>';
  //die();

	header('Location: ' . $return);
?>
